#============================================================
#	Player Info
#============================================================
# @datetime: 2022-5-11 23:03:06
#============================================================
class_name HUD_PlayerInfo
extends MarginContainer


signal show_item


onready var _weapon = get_node("VBoxContainer2/UserInfo/VBoxContainer/MarginContainer/AspectRatioContainer/Weapon")
onready var _health_bar := get_node("VBoxContainer2/UserInfo/VBoxContainer/HealthBar") as ProgressArray


#============================================================
#   内置
#============================================================
func _ready():
	WrapperHelper.get_property(Global.player) \
		.connect("property_changed", self, "_property_changed")


#============================================================
#   连接信号
#============================================================
func _property_changed(property, new_value):
	if property == "health":
		_health_bar.value = new_value


func _on_ShowItemPanel_pressed():
	emit_signal("show_item")


